//解构赋值
import React, { Component } from 'react';
import './App.css';
//引入组件
import Header from "./Header";
import Footer from "./Footer";
import SearchBox from "./SearchBox";

//react组件都必须 继承 React.Component
class App extends Component {

  //定义回调函数
  receiveMessage = (value)=>{
    // this ==== > 子组件
    console.log(value)
  }

  render() {
    return (
      //JSX语法 JS语言的扩展
      <div className="App">
        {/* <Header/>  
        <Footer/> */}
        <SearchBox placeholder="请输入搜索关键字"
        sendMessage={this.receiveMessage}/>
      </div>
    );
  }
  
}

export default App;
